FROM ubuntu:14.04
MAINTAINER  linbing <hawkerous@gmail.com> 

RUN apt-get -y update && apt-get install -y python-pip supervisor openssh-server \
                        bash-completion
RUN pip install pypiserver  
RUN pip install pip2pi

RUN mkdir /var/run/sshd
RUN echo 'root:aaaaaa' |chpasswd
RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config


COPY supervisord.conf  /etc/supervisor/conf.d/supervisord.conf

EXPOSE 80
EXPOSE 22
VOLUME ["/opt/pypi/"]

ADD run.sh /run.sh
RUN chmod -v +x /run.sh
CMD ["/run.sh"]

#CMD ["/usr/bin/supervisord"]
